// Upgrade NOTE: commented out 'float4 unity_DynamicLightmapST', a built-in variable
// Upgrade NOTE: commented out 'float4 unity_LightmapST', a built-in variable
// Upgrade NOTE: commented out 'float4 unity_ShadowFadeCenterAndType', a built-in variable
// Upgrade NOTE: replaced '_World2Object' with 'unity_WorldToObject'
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
// Upgrade NOTE: replaced 'unity_World2Shadow' with 'unity_WorldToShadow'

Shader "Hidden/TerrainEngine/Splatmap/Specular-AddPass" {
Properties {
 _SpecColor ("Specular Color", Color) = (0.5,0.5,0.5,1)
 _Shininess ("Shininess", Range(0.03,1)) = 0.078125
[HideInInspector]  _Control ("Control (RGBA)", 2D) = "red" { }
[HideInInspector]  _Splat3 ("Layer 3 (A)", 2D) = "white" { }
[HideInInspector]  _Splat2 ("Layer 2 (B)", 2D) = "white" { }
[HideInInspector]  _Splat1 ("Layer 1 (G)", 2D) = "white" { }
[HideInInspector]  _Splat0 ("Layer 0 (R)", 2D) = "white" { }
[HideInInspector]  _Normal3 ("Normal 3 (A)", 2D) = "bump" { }
[HideInInspector]  _Normal2 ("Normal 2 (B)", 2D) = "bump" { }
[HideInInspector]  _Normal1 ("Normal 1 (G)", 2D) = "bump" { }
[HideInInspector]  _Normal0 ("Normal 0 (R)", 2D) = "bump" { }
}
SubShader { 
 Tags { "QUEUE"="Geometry-99" "IGNOREPROJECTOR"="true" "RenderType"="Opaque" }
 Pass {
  Name "FORWARD"
  Tags { "LIGHTMODE"="ForwardBase" "QUEUE"="Geometry-99" "IGNOREPROJECTOR"="true" "SHADOWSUPPORT"="true" "RenderType"="Opaque" }
  ZWrite Off
  Blend One One
  GpuProgramID 62341
CGPROGRAM
//#pragma target 4.0

#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"
#define conv_mxt4x4_0(mat4x4) float4(mat4x4[0].x,mat4x4[1].x,mat4x4[2].x,mat4x4[3].x)
#define conv_mxt4x4_1(mat4x4) float4(mat4x4[0].y,mat4x4[1].y,mat4x4[2].y,mat4x4[3].y)
#define conv_mxt4x4_2(mat4x4) float4(mat4x4[0].z,mat4x4[1].z,mat4x4[2].z,mat4x4[3].z)
#define conv_mxt4x4_3(mat4x4) float4(mat4x4[0].w,mat4x4[1].w,mat4x4[2].w,mat4x4[3].w)


#define CODE_BLOCK_VERTEX
//uniform float4 _Time;
//uniform float4 _SinTime;
//uniform float4 _CosTime;
//uniform float4 unity_DeltaTime;
//uniform float3 _WorldSpaceCameraPos;
//uniform float4 _ProjectionParams;
//uniform float4 _ScreenParams;
//uniform float4 _ZBufferParams;
//uniform float4 unity_OrthoParams;
//uniform float4 unity_CameraWorldClipPlanes[6];
//uniform mat4x4 unity_CameraProjection;
//uniform mat4x4 unity_CameraInvProjection;
//uniform float4 _WorldSpaceLightPos0;
//uniform float4 _LightPositionRange;
//uniform float4 unity_4LightPosX0;
//uniform float4 unity_4LightPosY0;
//uniform float4 unity_4LightPosZ0;
//uniform float4 unity_4LightAtten0;
//uniform float4 unity_LightColor[8];
//uniform float4 unity_LightPosition[8];
//uniform float4 unity_LightAtten[8];
//uniform float4 unity_SpotDirection[8];
//uniform float4 unity_SHAr;
//uniform float4 unity_SHAg;
//uniform float4 unity_SHAb;
//uniform float4 unity_SHBr;
//uniform float4 unity_SHBg;
//uniform float4 unity_SHBb;
//uniform float4 unity_SHC;
uniform float3 unity_LightColor0;
uniform float3 unity_LightColor1;
uniform float3 unity_LightColor2;
uniform float3 unity_LightColor3;
uniform float4x4 unity_ShadowSplitSpheres;
uniform float4 unity_ShadowSplitSqRadii;
//uniform float4 unity_LightShadowBias;
//uniform float4 _LightSplitsNear;
//uniform float4 _LightSplitsFar;
uniform mat4x4x4 unity_WorldToShadow;
//uniform float4 _LightShadowData;
// uniform float4 unity_ShadowFadeCenterAndType;
//uniform mat4x4 UNITY_MATRIX_MVP;
//uniform mat4x4 UNITY_MATRIX_MV;
//uniform mat4x4 UNITY_MATRIX_IT_MV;
//uniform mat4x4 unity_ObjectToWorld;
uniform mat4x4 unity_WorldToObject;
//uniform float4 unity_LODFade;
//uniform float4 unity_WorldTransformParams;
//uniform mat4x4 glstate_matrix_transpose_modelview0;
//uniform mat4x4 UNITY_MATRIX_P;
//uniform float4 glstate_lightmodel_ambient;
//uniform mat4x4 unity_MatrixV;
//uniform mat4x4 unity_MatrixVP;
//uniform float4 unity_AmbientSky;
//uniform float4 unity_AmbientEquator;
//uniform float4 unity_AmbientGround;
//uniform float4 unity_FogColor;
//uniform float4 unity_FogParams;
// uniform float4 unity_LightmapST;
// uniform float4 unity_DynamicLightmapST;
//uniform float4 unity_SpecCube0_BoxMax;
//uniform float4 unity_SpecCube0_BoxMin;
//uniform float4 unity_SpecCube0_ProbePosition;
//uniform float4 unity_SpecCube0_HDR;
//uniform float4 unity_SpecCube1_BoxMax;
//uniform float4 unity_SpecCube1_BoxMin;
//uniform float4 unity_SpecCube1_ProbePosition;
//uniform float4 unity_SpecCube1_HDR;
uniform float4 unity_ColorSpaceGrey;
//uniform float4 unity_ColorSpaceDouble;
uniform float4 unity_ColorSpaceDielectricSpec;
uniform float4 unity_ColorSpaceLuminance;
//uniform float4 unity_Lightmap_HDR;
uniform float4 unity_DynamicLightmap_HDR;
uniform float4 _LightColor0;
uniform float4 _SpecColor;
uniform float4 _Control_ST;
uniform float _Shininess;
uniform float4 _Splat0_ST;
uniform float4 _Splat1_ST;
uniform float4 _Splat2_ST;
uniform float4 _Splat3_ST;
uniform sampler2D _Control;
uniform sampler2D _Splat0;
uniform sampler2D _Splat1;
uniform sampler2D _Splat2;
uniform sampler2D _Splat3;
struct appdata_t
{
    float4 vertex :POSITION0;
    float3 normal :NORMAL0;
    float4 texcoord :TEXCOORD0;
};

struct OUT_Data_Vert
{
    float4 texcoord :TEXCOORD0;
    float4 texcoord1 :TEXCOORD1;
    float3 texcoord2 :TEXCOORD2;
    float3 texcoord3 :TEXCOORD3;
    float2 texcoord4 :TEXCOORD4;
    float3 texcoord5 :TEXCOORD5;
    float4 texcoord7 :TEXCOORD7;
    float4 vertex :SV_POSITION;
};

struct v2f
{
    float4 texcoord :TEXCOORD0;
    float4 texcoord1 :TEXCOORD1;
    float3 texcoord2 :TEXCOORD2;
    float3 texcoord3 :TEXCOORD3;
    float2 texcoord4 :TEXCOORD4;
    float3 texcoord5 :TEXCOORD5;
};

struct OUT_Data_Frag
{
    float4 color :SV_Target0;
};

float4 t0;
float4 t16_0;
float3 t1;
float t16_2;
float3 t16_3;
float t12;
OUT_Data_Vert vert(appdata_t in_v)
{
    OUT_Data_Vert out_v;
    out_v.vertex = UnityObjectToClipPos(in_v.vertex);
    out_v.texcoord.xy = TRANSFORM_TEX(in_v.texcoord.xy, _Splat0);
    out_v.texcoord.zw = TRANSFORM_TEX(in_v.texcoord.xy, _Splat1);
    out_v.texcoord1.xy = TRANSFORM_TEX(in_v.texcoord.xy, _Splat2);
    out_v.texcoord1.zw = TRANSFORM_TEX(in_v.texcoord.xy, _Splat3);
    t0.x = (in_v.normal.x * conv_mxt4x4_0(unity_WorldToObject).x);
    t0.y = (in_v.normal.x * conv_mxt4x4_1(unity_WorldToObject).x);
    t0.z = (in_v.normal.x * conv_mxt4x4_2(unity_WorldToObject).x);
    t1.x = (in_v.normal.y * conv_mxt4x4_0(unity_WorldToObject).y);
    t1.y = (in_v.normal.y * conv_mxt4x4_1(unity_WorldToObject).y);
    t1.z = (in_v.normal.y * conv_mxt4x4_2(unity_WorldToObject).y);
    t0.xyz = (t0.xyz + t1.xyz);
    t1.x = (in_v.normal.z * conv_mxt4x4_0(unity_WorldToObject).z);
    t1.y = (in_v.normal.z * conv_mxt4x4_1(unity_WorldToObject).z);
    t1.z = (in_v.normal.z * conv_mxt4x4_2(unity_WorldToObject).z);
    t0.xyz = (t0.xyz + t1.xyz);
    t0.xyz = normalize(t0.xyz);
    out_v.texcoord2.xyz = t0.xyz;
    t1.xyz = (in_v.vertex.yyy * conv_mxt4x4_1(unity_ObjectToWorld).xyz);
    t1.xyz = ((conv_mxt4x4_0(unity_ObjectToWorld).xyz * in_v.vertex.xxx) + t1.xyz);
    t1.xyz = ((conv_mxt4x4_2(unity_ObjectToWorld).xyz * in_v.vertex.zzz) + t1.xyz);
    out_v.texcoord3.xyz = ((conv_mxt4x4_3(unity_ObjectToWorld).xyz * in_v.vertex.www) + t1.xyz);
    out_v.texcoord4.xy = TRANSFORM_TEX(in_v.texcoord.xy, _Control);
    t16_2 = (t0.y * t0.y);
    t16_2 = ((t0.x * t0.x) + (-t16_2));
    t16_0 = (t0.yzzx * t0.xyzz);
    t16_3.x = dot(unity_SHBr, t16_0);
    t16_3.y = dot(unity_SHBg, t16_0);
    t16_3.z = dot(unity_SHBb, t16_0);
    out_v.texcoord5.xyz = ((unity_SHC.xyz * float3(t16_2, t16_2, t16_2)) + t16_3.xyz);
    out_v.texcoord7 = float4(0, 0, 0, 0);
    return out_v;
}

#define CODE_BLOCK_FRAGMENT
float4 t16_0_d;
float4 t10_0;
float4 t16_1;
float4 t10_1;
float3 t16_2_d;
float3 t3;
float4 t16_3_d;
float4 t10_3;
float t16_4;
float t16_5;
float t16_6;
float3 t16_11;
float t16_21;
float t23;
float t16_23;
OUT_Data_Frag frag(v2f in_f)
{
    OUT_Data_Frag out_f;
    t16_0_d.xyz = in_f.texcoord2.xyz;
    t16_0_d.w = 1;
    t16_1.x = dot(unity_SHAr, t16_0_d);
    t16_1.y = dot(unity_SHAg, t16_0_d);
    t16_1.z = dot(unity_SHAb, t16_0_d);
    t16_0_d.xyz = (t16_1.xyz + in_f.texcoord5.xyz);
    t16_0_d.xyz = max(t16_0_d.xyz, float3(0, 0, 0));
    t16_2_d.xyz = log2(t16_0_d.xyz);
    t16_2_d.xyz = (t16_2_d.xyz * float3(0.416666657, 0.416666657, 0.416666657));
    t16_2_d.xyz = exp2(t16_2_d.xyz);
    t16_2_d.xyz = ((t16_2_d.xyz * float3(1.05499995, 1.05499995, 1.05499995)) + float3(-0.0549999997, (-0.0549999997), (-0.0549999997)));
    t16_2_d.xyz = max(t16_2_d.xyz, float3(0, 0, 0));
    t3.xyz = ((-in_f.texcoord3.xyz) + _WorldSpaceCameraPos.xyz);
    t23 = dot(t3.xyz, t3.xyz);
    t23 = rsqrt(t23);
    t16_0_d.xyz = ((t3.xyz * float3(t23, t23, t23)) + _WorldSpaceLightPos0.xyz);
    t16_0_d.xyz = normalize(t16_0_d.xyz);
    t16_0_d.x = dot(in_f.texcoord2.xyz, t16_0_d.xyz);
    t16_0_d.x = max(t16_0_d.x, 0);
    t16_23 = log2(t16_0_d.x);
    t16_0_d.x = (_Shininess * 128);
    t16_23 = (t16_23 * t16_0_d.x);
    t16_23 = exp2(t16_23);
    t10_0 = tex2D(_Splat0, in_f.texcoord.xy);
    t10_1 = tex2D(_Splat1, in_f.texcoord.zw);
    t10_3 = tex2D(_Control, in_f.texcoord4.xy);
    t16_4 = dot(t10_3, float4(1, 1, 1, 1));
    t16_5 = (t16_4 + 0.00100000005);
    t16_3_d = (t10_3 / float4(t16_5, t16_5, t16_5, t16_5));
    t16_1 = (t10_1 * t16_3_d.yyyy);
    t16_0_d = ((t16_3_d.xxxx * t10_0) + t16_1);
    t10_1 = tex2D(_Splat2, in_f.texcoord1.xy);
    t16_0_d = ((t16_3_d.zzzz * t10_1) + t16_0_d);
    t10_1 = tex2D(_Splat3, in_f.texcoord1.zw);
    t16_0_d = ((t16_3_d.wwww * t10_1) + t16_0_d);
    t16_23 = (t16_0_d.w * t16_23);
    t16_11.xyz = (_LightColor0.xyz * _SpecColor.xyz);
    t16_3_d.xyz = (float3(t16_23, t16_23, t16_23) * t16_11.xyz);
    t16_11.xyz = (t16_0_d.xyz * _LightColor0.xyz);
    t16_6 = dot(in_f.texcoord2.xyz, _WorldSpaceLightPos0.xyz);
    t16_6 = max(t16_6, 0);
    t16_3_d.xyz = ((t16_11.xyz * float3(t16_6, t16_6, t16_6)) + t16_3_d.xyz);
    t16_11.xyz = ((t16_0_d.xyz * t16_2_d.xyz) + t16_3_d.xyz);
    out_f.color.xyz = (float3(t16_4, t16_4, t16_4) * t16_11.xyz);
    out_f.color.w = 1;
    return out_f;
}


ENDCG

}
 Pass {
  Name "FORWARD"
  Tags { "LIGHTMODE"="ForwardAdd" "QUEUE"="Geometry-99" "IGNOREPROJECTOR"="true" "RenderType"="Opaque" }
  ZWrite Off
  Blend One One
  GpuProgramID 94075
CGPROGRAM
//#pragma target 4.0

#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"
#define conv_mxt4x4_0(mat4x4) float4(mat4x4[0].x,mat4x4[1].x,mat4x4[2].x,mat4x4[3].x)
#define conv_mxt4x4_1(mat4x4) float4(mat4x4[0].y,mat4x4[1].y,mat4x4[2].y,mat4x4[3].y)
#define conv_mxt4x4_2(mat4x4) float4(mat4x4[0].z,mat4x4[1].z,mat4x4[2].z,mat4x4[3].z)
#define conv_mxt4x4_3(mat4x4) float4(mat4x4[0].w,mat4x4[1].w,mat4x4[2].w,mat4x4[3].w)


#define CODE_BLOCK_VERTEX
//uniform float4 _Time;
//uniform float4 _SinTime;
//uniform float4 _CosTime;
//uniform float4 unity_DeltaTime;
//uniform float3 _WorldSpaceCameraPos;
//uniform float4 _ProjectionParams;
//uniform float4 _ScreenParams;
//uniform float4 _ZBufferParams;
//uniform float4 unity_OrthoParams;
//uniform float4 unity_CameraWorldClipPlanes[6];
//uniform mat4x4 unity_CameraProjection;
//uniform mat4x4 unity_CameraInvProjection;
//uniform float4 _WorldSpaceLightPos0;
//uniform float4 _LightPositionRange;
//uniform float4 unity_4LightPosX0;
//uniform float4 unity_4LightPosY0;
//uniform float4 unity_4LightPosZ0;
//uniform float4 unity_4LightAtten0;
//uniform float4 unity_LightColor[8];
//uniform float4 unity_LightPosition[8];
//uniform float4 unity_LightAtten[8];
//uniform float4 unity_SpotDirection[8];
//uniform float4 unity_SHAr;
//uniform float4 unity_SHAg;
//uniform float4 unity_SHAb;
//uniform float4 unity_SHBr;
//uniform float4 unity_SHBg;
//uniform float4 unity_SHBb;
//uniform float4 unity_SHC;
uniform float3 unity_LightColor0;
uniform float3 unity_LightColor1;
uniform float3 unity_LightColor2;
uniform float3 unity_LightColor3;
uniform float4x4 unity_ShadowSplitSpheres;
uniform float4 unity_ShadowSplitSqRadii;
//uniform float4 unity_LightShadowBias;
//uniform float4 _LightSplitsNear;
//uniform float4 _LightSplitsFar;
uniform mat4x4x4 unity_WorldToShadow;
//uniform float4 _LightShadowData;
// uniform float4 unity_ShadowFadeCenterAndType;
//uniform mat4x4 UNITY_MATRIX_MVP;
//uniform mat4x4 UNITY_MATRIX_MV;
//uniform mat4x4 UNITY_MATRIX_IT_MV;
//uniform mat4x4 unity_ObjectToWorld;
uniform mat4x4 unity_WorldToObject;
//uniform float4 unity_LODFade;
//uniform float4 unity_WorldTransformParams;
//uniform mat4x4 glstate_matrix_transpose_modelview0;
//uniform mat4x4 UNITY_MATRIX_P;
//uniform float4 glstate_lightmodel_ambient;
//uniform mat4x4 unity_MatrixV;
//uniform mat4x4 unity_MatrixVP;
//uniform float4 unity_AmbientSky;
//uniform float4 unity_AmbientEquator;
//uniform float4 unity_AmbientGround;
//uniform float4 unity_FogColor;
//uniform float4 unity_FogParams;
// uniform float4 unity_LightmapST;
// uniform float4 unity_DynamicLightmapST;
//uniform float4 unity_SpecCube0_BoxMax;
//uniform float4 unity_SpecCube0_BoxMin;
//uniform float4 unity_SpecCube0_ProbePosition;
//uniform float4 unity_SpecCube0_HDR;
//uniform float4 unity_SpecCube1_BoxMax;
//uniform float4 unity_SpecCube1_BoxMin;
//uniform float4 unity_SpecCube1_ProbePosition;
//uniform float4 unity_SpecCube1_HDR;
uniform float4 unity_ColorSpaceGrey;
//uniform float4 unity_ColorSpaceDouble;
uniform float4 unity_ColorSpaceDielectricSpec;
uniform float4 unity_ColorSpaceLuminance;
//uniform float4 unity_Lightmap_HDR;
uniform float4 unity_DynamicLightmap_HDR;
uniform float4 _LightColor0;
uniform float4 _SpecColor;
uniform mat4x4 unity_WorldToLight;
uniform float4 _Control_ST;
uniform float _Shininess;
uniform float4 _Splat0_ST;
uniform float4 _Splat1_ST;
uniform float4 _Splat2_ST;
uniform float4 _Splat3_ST;
uniform sampler2D _Control;
uniform sampler2D _Splat0;
uniform sampler2D _Splat1;
uniform sampler2D _Splat2;
uniform sampler2D _Splat3;
uniform sampler2D _LightTexture0;
struct appdata_t
{
    float4 vertex :POSITION0;
    float3 normal :NORMAL0;
    float4 texcoord :TEXCOORD0;
};

struct OUT_Data_Vert
{
    float4 texcoord :TEXCOORD0;
    float4 texcoord1 :TEXCOORD1;
    float3 texcoord2 :TEXCOORD2;
    float3 texcoord3 :TEXCOORD3;
    float2 texcoord4 :TEXCOORD4;
    float4 vertex :SV_POSITION;
};

struct v2f
{
    float4 texcoord :TEXCOORD0;
    float4 texcoord1 :TEXCOORD1;
    float3 texcoord2 :TEXCOORD2;
    float3 texcoord3 :TEXCOORD3;
    float2 texcoord4 :TEXCOORD4;
};

struct OUT_Data_Frag
{
    float4 color :SV_Target0;
};

float4 t0;
float3 t1;
float t6;
OUT_Data_Vert vert(appdata_t in_v)
{
    OUT_Data_Vert out_v;
    out_v.vertex = UnityObjectToClipPos(in_v.vertex);
    out_v.texcoord.xy = TRANSFORM_TEX(in_v.texcoord.xy, _Splat0);
    out_v.texcoord.zw = TRANSFORM_TEX(in_v.texcoord.xy, _Splat1);
    out_v.texcoord1.xy = TRANSFORM_TEX(in_v.texcoord.xy, _Splat2);
    out_v.texcoord1.zw = TRANSFORM_TEX(in_v.texcoord.xy, _Splat3);
    t0.x = (in_v.normal.x * conv_mxt4x4_0(unity_WorldToObject).x);
    t0.y = (in_v.normal.x * conv_mxt4x4_1(unity_WorldToObject).x);
    t0.z = (in_v.normal.x * conv_mxt4x4_2(unity_WorldToObject).x);
    t1.x = (in_v.normal.y * conv_mxt4x4_0(unity_WorldToObject).y);
    t1.y = (in_v.normal.y * conv_mxt4x4_1(unity_WorldToObject).y);
    t1.z = (in_v.normal.y * conv_mxt4x4_2(unity_WorldToObject).y);
    t0.xyz = (t0.xyz + t1.xyz);
    t1.x = (in_v.normal.z * conv_mxt4x4_0(unity_WorldToObject).z);
    t1.y = (in_v.normal.z * conv_mxt4x4_1(unity_WorldToObject).z);
    t1.z = (in_v.normal.z * conv_mxt4x4_2(unity_WorldToObject).z);
    t0.xyz = (t0.xyz + t1.xyz);
    t0.xyz = normalize(t0.xyz);
    out_v.texcoord2.xyz = t0.xyz;
    t0.xyz = (in_v.vertex.yyy * conv_mxt4x4_1(unity_ObjectToWorld).xyz);
    t0.xyz = ((conv_mxt4x4_0(unity_ObjectToWorld).xyz * in_v.vertex.xxx) + t0.xyz);
    t0.xyz = ((conv_mxt4x4_2(unity_ObjectToWorld).xyz * in_v.vertex.zzz) + t0.xyz);
    out_v.texcoord3.xyz = ((conv_mxt4x4_3(unity_ObjectToWorld).xyz * in_v.vertex.www) + t0.xyz);
    out_v.texcoord4.xy = TRANSFORM_TEX(in_v.texcoord.xy, _Control);
    return out_v;
}

#define CODE_BLOCK_FRAGMENT
float3 t0_d;
float3 t16_0;
float3 t1_d;
float4 t16_1;
float4 t10_1;
float4 t16_2;
float4 t16_3;
float4 t10_3;
float4 t16_4;
float4 t10_4;
float3 t16_5;
float3 t16_6;
float t7;
float t16_7;
float t10_7;
float t21;
OUT_Data_Frag frag(v2f in_f)
{
    OUT_Data_Frag out_f;
    t0_d.xyz = ((-in_f.texcoord3.xyz) + _WorldSpaceLightPos0.xyz);
    t0_d.xyz = normalize(t0_d.xyz);
    t1_d.xyz = ((-in_f.texcoord3.xyz) + _WorldSpaceCameraPos.xyz);
    t21 = dot(t1_d.xyz, t1_d.xyz);
    t21 = rsqrt(t21);
    t16_2.xyz = ((t1_d.xyz * float3(t21, t21, t21)) + t0_d.xyz);
    t16_2.w = dot(in_f.texcoord2.xyz, t0_d.xyz);
    t16_3.x = dot(t16_2.xyz, t16_2.xyz);
    t16_3.x = rsqrt(t16_3.x);
    t16_2.xyz = (t16_2.xyz * t16_3.xxx);
    t16_2.x = dot(in_f.texcoord2.xyz, t16_2.xyz);
    t16_2.xw = max(t16_2.xw, float2(0, 0));
    t16_0.x = log2(t16_2.x);
    t16_2.x = (_Shininess * 128);
    t16_0.x = (t16_0.x * t16_2.x);
    t16_0.x = exp2(t16_0.x);
    t10_1 = tex2D(_Splat0, in_f.texcoord.xy);
    t10_3 = tex2D(_Splat1, in_f.texcoord.zw);
    t10_4 = tex2D(_Control, in_f.texcoord4.xy);
    t16_2.x = dot(t10_4, float4(1, 1, 1, 1));
    t16_7 = (t16_2.x + 0.00100000005);
    t16_4 = (t10_4 / float4(t16_7, t16_7, t16_7, t16_7));
    t16_3 = (t10_3 * t16_4.yyyy);
    t16_1 = ((t16_4.xxxx * t10_1) + t16_3);
    t10_3 = tex2D(_Splat2, in_f.texcoord1.xy);
    t16_1 = ((t16_4.zzzz * t10_3) + t16_1);
    t10_3 = tex2D(_Splat3, in_f.texcoord1.zw);
    t16_1 = ((t16_4.wwww * t10_3) + t16_1);
    t16_0.x = (t16_0.x * t16_1.w);
    t16_5.xyz = (in_f.texcoord3.yyy * conv_mxt4x4_1(unity_WorldToLight).xyz);
    t16_5.xyz = ((conv_mxt4x4_0(unity_WorldToLight).xyz * in_f.texcoord3.xxx) + t16_5.xyz);
    t16_5.xyz = ((conv_mxt4x4_2(unity_WorldToLight).xyz * in_f.texcoord3.zzz) + t16_5.xyz);
    t16_5.xyz = (t16_5.xyz + conv_mxt4x4_3(unity_WorldToLight).xyz);
    t7 = dot(t16_5.xyz, t16_5.xyz);
    t10_7 = tex2D(_LightTexture0, float2(t7, t7)).w;
    t16_5.xyz = (float3(t10_7, t10_7, t10_7) * _LightColor0.xyz);
    t16_6.xyz = (t16_5.xyz * _SpecColor.xyz);
    t16_5.xyz = (t16_1.xyz * t16_5.xyz);
    t16_0.xyz = (t16_0.xxx * t16_6.xyz);
    t16_0.xyz = ((t16_5.xyz * t16_2.www) + t16_0.xyz);
    out_f.color.xyz = (t16_2.xxx * t16_0.xyz);
    out_f.color.w = 1;
    return out_f;
}


ENDCG

}
 Pass {
  Name "PREPASS"
  Tags { "LIGHTMODE"="PrePassBase" "QUEUE"="Geometry-99" "IGNOREPROJECTOR"="true" "RenderType"="Opaque" }
  ZWrite Off
  Blend One One
  GpuProgramID 194546
CGPROGRAM
//#pragma target 4.0

#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"
#define conv_mxt4x4_0(mat4x4) float4(mat4x4[0].x,mat4x4[1].x,mat4x4[2].x,mat4x4[3].x)
#define conv_mxt4x4_1(mat4x4) float4(mat4x4[0].y,mat4x4[1].y,mat4x4[2].y,mat4x4[3].y)
#define conv_mxt4x4_2(mat4x4) float4(mat4x4[0].z,mat4x4[1].z,mat4x4[2].z,mat4x4[3].z)
#define conv_mxt4x4_3(mat4x4) float4(mat4x4[0].w,mat4x4[1].w,mat4x4[2].w,mat4x4[3].w)


#define CODE_BLOCK_VERTEX
//uniform float4 _Time;
//uniform float4 _SinTime;
//uniform float4 _CosTime;
//uniform float4 unity_DeltaTime;
//uniform float3 _WorldSpaceCameraPos;
//uniform float4 _ProjectionParams;
//uniform float4 _ScreenParams;
//uniform float4 _ZBufferParams;
//uniform float4 unity_OrthoParams;
//uniform float4 unity_CameraWorldClipPlanes[6];
//uniform mat4x4 unity_CameraProjection;
//uniform mat4x4 unity_CameraInvProjection;
//uniform float4 _WorldSpaceLightPos0;
//uniform float4 _LightPositionRange;
//uniform float4 unity_4LightPosX0;
//uniform float4 unity_4LightPosY0;
//uniform float4 unity_4LightPosZ0;
//uniform float4 unity_4LightAtten0;
//uniform float4 unity_LightColor[8];
//uniform float4 unity_LightPosition[8];
//uniform float4 unity_LightAtten[8];
//uniform float4 unity_SpotDirection[8];
//uniform float4 unity_SHAr;
//uniform float4 unity_SHAg;
//uniform float4 unity_SHAb;
//uniform float4 unity_SHBr;
//uniform float4 unity_SHBg;
//uniform float4 unity_SHBb;
//uniform float4 unity_SHC;
uniform float3 unity_LightColor0;
uniform float3 unity_LightColor1;
uniform float3 unity_LightColor2;
uniform float3 unity_LightColor3;
uniform float4x4 unity_ShadowSplitSpheres;
uniform float4 unity_ShadowSplitSqRadii;
//uniform float4 unity_LightShadowBias;
//uniform float4 _LightSplitsNear;
//uniform float4 _LightSplitsFar;
uniform mat4x4x4 unity_WorldToShadow;
//uniform float4 _LightShadowData;
// uniform float4 unity_ShadowFadeCenterAndType;
//uniform mat4x4 UNITY_MATRIX_MVP;
//uniform mat4x4 UNITY_MATRIX_MV;
//uniform mat4x4 UNITY_MATRIX_IT_MV;
//uniform mat4x4 unity_ObjectToWorld;
uniform mat4x4 unity_WorldToObject;
//uniform float4 unity_LODFade;
//uniform float4 unity_WorldTransformParams;
//uniform mat4x4 glstate_matrix_transpose_modelview0;
//uniform mat4x4 UNITY_MATRIX_P;
//uniform float4 glstate_lightmodel_ambient;
//uniform mat4x4 unity_MatrixV;
//uniform mat4x4 unity_MatrixVP;
//uniform float4 unity_AmbientSky;
//uniform float4 unity_AmbientEquator;
//uniform float4 unity_AmbientGround;
//uniform float4 unity_FogColor;
//uniform float4 unity_FogParams;
// uniform float4 unity_LightmapST;
// uniform float4 unity_DynamicLightmapST;
//uniform float4 unity_SpecCube0_BoxMax;
//uniform float4 unity_SpecCube0_BoxMin;
//uniform float4 unity_SpecCube0_ProbePosition;
//uniform float4 unity_SpecCube0_HDR;
//uniform float4 unity_SpecCube1_BoxMax;
//uniform float4 unity_SpecCube1_BoxMin;
//uniform float4 unity_SpecCube1_ProbePosition;
//uniform float4 unity_SpecCube1_HDR;
uniform float4 unity_ColorSpaceGrey;
//uniform float4 unity_ColorSpaceDouble;
uniform float4 unity_ColorSpaceDielectricSpec;
uniform float4 unity_ColorSpaceLuminance;
//uniform float4 unity_Lightmap_HDR;
uniform float4 unity_DynamicLightmap_HDR;
uniform float4 _LightColor0;
uniform float4 _SpecColor;
uniform float4 _Control_ST;
uniform float _Shininess;
uniform sampler2D _Control;
struct appdata_t
{
    float4 vertex :POSITION0;
    float3 normal :NORMAL0;
    float4 texcoord :TEXCOORD0;
};

struct OUT_Data_Vert
{
    float3 texcoord :TEXCOORD0;
    float3 texcoord1 :TEXCOORD1;
    float2 texcoord2 :TEXCOORD2;
    float4 vertex :SV_POSITION;
};

struct v2f
{
    float3 texcoord :TEXCOORD0;
    float2 texcoord2 :TEXCOORD2;
};

struct OUT_Data_Frag
{
    float4 color :SV_Target0;
};

float4 t0;
float3 t1;
float t6;
OUT_Data_Vert vert(appdata_t in_v)
{
    OUT_Data_Vert out_v;
    out_v.vertex = UnityObjectToClipPos(in_v.vertex);
    t0.x = (in_v.normal.x * conv_mxt4x4_0(unity_WorldToObject).x);
    t0.y = (in_v.normal.x * conv_mxt4x4_1(unity_WorldToObject).x);
    t0.z = (in_v.normal.x * conv_mxt4x4_2(unity_WorldToObject).x);
    t1.x = (in_v.normal.y * conv_mxt4x4_0(unity_WorldToObject).y);
    t1.y = (in_v.normal.y * conv_mxt4x4_1(unity_WorldToObject).y);
    t1.z = (in_v.normal.y * conv_mxt4x4_2(unity_WorldToObject).y);
    t0.xyz = (t0.xyz + t1.xyz);
    t1.x = (in_v.normal.z * conv_mxt4x4_0(unity_WorldToObject).z);
    t1.y = (in_v.normal.z * conv_mxt4x4_1(unity_WorldToObject).z);
    t1.z = (in_v.normal.z * conv_mxt4x4_2(unity_WorldToObject).z);
    t0.xyz = (t0.xyz + t1.xyz);
    t0.xyz = normalize(t0.xyz);
    out_v.texcoord.xyz = t0.xyz;
    t0.xyz = (in_v.vertex.yyy * conv_mxt4x4_1(unity_ObjectToWorld).xyz);
    t0.xyz = ((conv_mxt4x4_0(unity_ObjectToWorld).xyz * in_v.vertex.xxx) + t0.xyz);
    t0.xyz = ((conv_mxt4x4_2(unity_ObjectToWorld).xyz * in_v.vertex.zzz) + t0.xyz);
    out_v.texcoord1.xyz = ((conv_mxt4x4_3(unity_ObjectToWorld).xyz * in_v.vertex.www) + t0.xyz);
    out_v.texcoord2.xy = TRANSFORM_TEX(in_v.texcoord.xy, _Control);
    return out_v;
}

#define CODE_BLOCK_FRAGMENT
float3 t10_0;
float4 t10_1;
float t16_2;
OUT_Data_Frag frag(v2f in_f)
{
    OUT_Data_Frag out_f;
    t10_0.xyz = ((in_f.texcoord.xyz * float3(0.5, 0.5, 0.5)) + float3(0.5, 0.5, 0.5));
    t10_1 = tex2D(_Control, in_f.texcoord2.xy);
    t16_2 = dot(t10_1, float4(1, 1, 1, 1));
    out_f.color.xyz = (t10_0.xyz * float3(t16_2, t16_2, t16_2));
    out_f.color.w = (t16_2 * _Shininess);
    return out_f;
}


ENDCG

}
 Pass {
  Name "PREPASS"
  Tags { "LIGHTMODE"="PrePassFinal" "QUEUE"="Geometry-99" "IGNOREPROJECTOR"="true" "RenderType"="Opaque" }
  ZWrite Off
  Blend One One
  GpuProgramID 242999
CGPROGRAM
//#pragma target 4.0

#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"
#define conv_mxt4x4_0(mat4x4) float4(mat4x4[0].x,mat4x4[1].x,mat4x4[2].x,mat4x4[3].x)
#define conv_mxt4x4_1(mat4x4) float4(mat4x4[0].y,mat4x4[1].y,mat4x4[2].y,mat4x4[3].y)
#define conv_mxt4x4_2(mat4x4) float4(mat4x4[0].z,mat4x4[1].z,mat4x4[2].z,mat4x4[3].z)
#define conv_mxt4x4_3(mat4x4) float4(mat4x4[0].w,mat4x4[1].w,mat4x4[2].w,mat4x4[3].w)


#define CODE_BLOCK_VERTEX
//uniform float4 _Time;
//uniform float4 _SinTime;
//uniform float4 _CosTime;
//uniform float4 unity_DeltaTime;
//uniform float3 _WorldSpaceCameraPos;
//uniform float4 _ProjectionParams;
//uniform float4 _ScreenParams;
//uniform float4 _ZBufferParams;
//uniform float4 unity_OrthoParams;
//uniform float4 unity_CameraWorldClipPlanes[6];
//uniform mat4x4 unity_CameraProjection;
//uniform mat4x4 unity_CameraInvProjection;
//uniform float4 _WorldSpaceLightPos0;
//uniform float4 _LightPositionRange;
//uniform float4 unity_4LightPosX0;
//uniform float4 unity_4LightPosY0;
//uniform float4 unity_4LightPosZ0;
//uniform float4 unity_4LightAtten0;
//uniform float4 unity_LightColor[8];
//uniform float4 unity_LightPosition[8];
//uniform float4 unity_LightAtten[8];
//uniform float4 unity_SpotDirection[8];
//uniform float4 unity_SHAr;
//uniform float4 unity_SHAg;
//uniform float4 unity_SHAb;
//uniform float4 unity_SHBr;
//uniform float4 unity_SHBg;
//uniform float4 unity_SHBb;
//uniform float4 unity_SHC;
uniform float3 unity_LightColor0;
uniform float3 unity_LightColor1;
uniform float3 unity_LightColor2;
uniform float3 unity_LightColor3;
uniform float4x4 unity_ShadowSplitSpheres;
uniform float4 unity_ShadowSplitSqRadii;
//uniform float4 unity_LightShadowBias;
//uniform float4 _LightSplitsNear;
//uniform float4 _LightSplitsFar;
uniform mat4x4x4 unity_WorldToShadow;
//uniform float4 _LightShadowData;
// uniform float4 unity_ShadowFadeCenterAndType;
//uniform mat4x4 UNITY_MATRIX_MVP;
//uniform mat4x4 UNITY_MATRIX_MV;
//uniform mat4x4 UNITY_MATRIX_IT_MV;
//uniform mat4x4 unity_ObjectToWorld;
uniform mat4x4 unity_WorldToObject;
//uniform float4 unity_LODFade;
//uniform float4 unity_WorldTransformParams;
//uniform mat4x4 glstate_matrix_transpose_modelview0;
//uniform mat4x4 UNITY_MATRIX_P;
//uniform float4 glstate_lightmodel_ambient;
//uniform mat4x4 unity_MatrixV;
//uniform mat4x4 unity_MatrixVP;
//uniform float4 unity_AmbientSky;
//uniform float4 unity_AmbientEquator;
//uniform float4 unity_AmbientGround;
//uniform float4 unity_FogColor;
//uniform float4 unity_FogParams;
// uniform float4 unity_LightmapST;
// uniform float4 unity_DynamicLightmapST;
//uniform float4 unity_SpecCube0_BoxMax;
//uniform float4 unity_SpecCube0_BoxMin;
//uniform float4 unity_SpecCube0_ProbePosition;
//uniform float4 unity_SpecCube0_HDR;
//uniform float4 unity_SpecCube1_BoxMax;
//uniform float4 unity_SpecCube1_BoxMin;
//uniform float4 unity_SpecCube1_ProbePosition;
//uniform float4 unity_SpecCube1_HDR;
uniform float4 unity_ColorSpaceGrey;
//uniform float4 unity_ColorSpaceDouble;
uniform float4 unity_ColorSpaceDielectricSpec;
uniform float4 unity_ColorSpaceLuminance;
//uniform float4 unity_Lightmap_HDR;
uniform float4 unity_DynamicLightmap_HDR;
uniform float4 _LightColor0;
uniform float4 _SpecColor;
uniform float4 _Control_ST;
uniform float _Shininess;
uniform float4 _Splat0_ST;
uniform float4 _Splat1_ST;
uniform float4 _Splat2_ST;
uniform float4 _Splat3_ST;
uniform float4 unity_Ambient;
uniform sampler2D _Control;
uniform sampler2D _Splat0;
uniform sampler2D _Splat1;
uniform sampler2D _Splat2;
uniform sampler2D _Splat3;
uniform sampler2D _LightBuffer;
struct appdata_t
{
    float4 vertex :POSITION0;
    float3 normal :NORMAL0;
    float4 texcoord :TEXCOORD0;
};

struct OUT_Data_Vert
{
    float4 texcoord :TEXCOORD0;
    float4 texcoord1 :TEXCOORD1;
    float3 texcoord2 :TEXCOORD2;
    float2 texcoord3 :TEXCOORD3;
    float4 texcoord4 :TEXCOORD4;
    float4 texcoord5 :TEXCOORD5;
    float3 texcoord6 :TEXCOORD6;
    float4 vertex :SV_POSITION;
};

struct v2f
{
    float4 texcoord :TEXCOORD0;
    float4 texcoord1 :TEXCOORD1;
    float2 texcoord3 :TEXCOORD3;
    float4 texcoord4 :TEXCOORD4;
    float3 texcoord6 :TEXCOORD6;
};

struct OUT_Data_Frag
{
    float4 color :SV_Target0;
};

float4 t0;
float4 t1;
float4 t16_1;
float3 t16_2;
float3 t16_3;
float t12;
OUT_Data_Vert vert(appdata_t in_v)
{
    OUT_Data_Vert out_v;
    t0 = UnityObjectToClipPos(in_v.vertex);
    out_v.vertex = t0;
    out_v.texcoord.xy = TRANSFORM_TEX(in_v.texcoord.xy, _Splat0);
    out_v.texcoord.zw = TRANSFORM_TEX(in_v.texcoord.xy, _Splat1);
    out_v.texcoord1.xy = TRANSFORM_TEX(in_v.texcoord.xy, _Splat2);
    out_v.texcoord1.zw = TRANSFORM_TEX(in_v.texcoord.xy, _Splat3);
    t1.xyz = (in_v.vertex.yyy * conv_mxt4x4_1(unity_ObjectToWorld).xyz);
    t1.xyz = ((conv_mxt4x4_0(unity_ObjectToWorld).xyz * in_v.vertex.xxx) + t1.xyz);
    t1.xyz = ((conv_mxt4x4_2(unity_ObjectToWorld).xyz * in_v.vertex.zzz) + t1.xyz);
    out_v.texcoord2.xyz = ((conv_mxt4x4_3(unity_ObjectToWorld).xyz * in_v.vertex.www) + t1.xyz);
    out_v.texcoord3.xy = TRANSFORM_TEX(in_v.texcoord.xy, _Control);
    t0.y = (t0.y * _ProjectionParams.x);
    t1.xzw = (t0.xwy * float3(0.5, 0.5, 0.5));
    out_v.texcoord4.zw = t0.zw;
    out_v.texcoord4.xy = (t1.zz + t1.xw);
    out_v.texcoord5 = float4(0, 0, 0, 0);
    t0.x = (in_v.normal.x * conv_mxt4x4_0(unity_WorldToObject).x);
    t0.y = (in_v.normal.x * conv_mxt4x4_1(unity_WorldToObject).x);
    t0.z = (in_v.normal.x * conv_mxt4x4_2(unity_WorldToObject).x);
    t1.x = (in_v.normal.y * conv_mxt4x4_0(unity_WorldToObject).y);
    t1.y = (in_v.normal.y * conv_mxt4x4_1(unity_WorldToObject).y);
    t1.z = (in_v.normal.y * conv_mxt4x4_2(unity_WorldToObject).y);
    t0.xyz = (t0.xyz + t1.xyz);
    t1.x = (in_v.normal.z * conv_mxt4x4_0(unity_WorldToObject).z);
    t1.y = (in_v.normal.z * conv_mxt4x4_1(unity_WorldToObject).z);
    t1.z = (in_v.normal.z * conv_mxt4x4_2(unity_WorldToObject).z);
    t0.xyz = (t0.xyz + t1.xyz);
    t0.xyz = normalize(t0.xyz);
    t16_2.x = (t0.y * t0.y);
    t16_2.x = ((t0.x * t0.x) + (-t16_2.x));
    t16_1 = (t0.yzzx * t0.xyzz);
    t16_3.x = dot(unity_SHBr, t16_1);
    t16_3.y = dot(unity_SHBg, t16_1);
    t16_3.z = dot(unity_SHBb, t16_1);
    t16_2.xyz = ((unity_SHC.xyz * t16_2.xxx) + t16_3.xyz);
    t0.w = 1;
    t16_3.x = dot(unity_SHAr, t0);
    t16_3.y = dot(unity_SHAg, t0);
    t16_3.z = dot(unity_SHAb, t0);
    t16_2.xyz = (t16_2.xyz + t16_3.xyz);
    t16_2.xyz = max(t16_2.xyz, float3(0, 0, 0));
    t0.xyz = log2(t16_2.xyz);
    t0.xyz = (t0.xyz * float3(0.416666657, 0.416666657, 0.416666657));
    t0.xyz = exp2(t0.xyz);
    t0.xyz = ((t0.xyz * float3(1.05499995, 1.05499995, 1.05499995)) + float3(-0.0549999997, (-0.0549999997), (-0.0549999997)));
    out_v.texcoord6.xyz = max(t0.xyz, float3(0, 0, 0));
    return out_v;
}

#define CODE_BLOCK_FRAGMENT
float4 t16_0;
float4 t10_0;
float2 t1_d;
float4 t16_1_d;
float4 t10_1;
float3 t2;
float4 t16_2_d;
float4 t10_2;
float t16_3_d;
float t16_4;
float3 t16_5;
float3 t16_9;
OUT_Data_Frag frag(v2f in_f)
{
    OUT_Data_Frag out_f;
    t10_0 = tex2D(_Splat0, in_f.texcoord.xy);
    t10_1 = tex2D(_Splat1, in_f.texcoord.zw);
    t10_2 = tex2D(_Control, in_f.texcoord3.xy);
    t16_3_d = dot(t10_2, float4(1, 1, 1, 1));
    t16_4 = (t16_3_d + 0.00100000005);
    t16_2_d = (t10_2 / float4(t16_4, t16_4, t16_4, t16_4));
    t16_1_d = (t10_1 * t16_2_d.yyyy);
    t16_0 = ((t16_2_d.xxxx * t10_0) + t16_1_d);
    t10_1 = tex2D(_Splat2, in_f.texcoord1.xy);
    t16_0 = ((t16_2_d.zzzz * t10_1) + t16_0);
    t10_1 = tex2D(_Splat3, in_f.texcoord1.zw);
    t16_0 = ((t16_2_d.wwww * t10_1) + t16_0);
    t1_d.xy = (in_f.texcoord4.xy / in_f.texcoord4.ww);
    t10_1 = tex2D(_LightBuffer, t1_d.xy);
    t16_1_d = max(t10_1, float4(0.00100000005, 0.00100000005, 0.00100000005, 0.00100000005));
    t16_1_d = log2(t16_1_d);
    t16_9.x = (t16_0.w * (-t16_1_d.w));
    t2.xyz = ((-t16_1_d.xyz) + in_f.texcoord6.xyz);
    t16_5.xyz = (t2.xyz * _SpecColor.xyz);
    t16_9.xyz = (t16_9.xxx * t16_5.xyz);
    t16_9.xyz = ((t16_0.xyz * t2.xyz) + t16_9.xyz);
    out_f.color.xyz = (float3(t16_3_d, t16_3_d, t16_3_d) * t16_9.xyz);
    out_f.color.w = 1;
    return out_f;
}


ENDCG

}
 Pass {
  Name "DEFERRED"
  Tags { "LIGHTMODE"="Deferred" "QUEUE"="Geometry-99" "IGNOREPROJECTOR"="true" "RenderType"="Opaque" }
  ZWrite Off
  Blend One One
  GpuProgramID 320883
CGPROGRAM
//#pragma target 4.0

#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"
#define conv_mxt4x4_0(mat4x4) float4(mat4x4[0].x,mat4x4[1].x,mat4x4[2].x,mat4x4[3].x)
#define conv_mxt4x4_1(mat4x4) float4(mat4x4[0].y,mat4x4[1].y,mat4x4[2].y,mat4x4[3].y)
#define conv_mxt4x4_2(mat4x4) float4(mat4x4[0].z,mat4x4[1].z,mat4x4[2].z,mat4x4[3].z)
#define conv_mxt4x4_3(mat4x4) float4(mat4x4[0].w,mat4x4[1].w,mat4x4[2].w,mat4x4[3].w)


#define CODE_BLOCK_VERTEX
//uniform float4 _Time;
//uniform float4 _SinTime;
//uniform float4 _CosTime;
//uniform float4 unity_DeltaTime;
//uniform float3 _WorldSpaceCameraPos;
//uniform float4 _ProjectionParams;
//uniform float4 _ScreenParams;
//uniform float4 _ZBufferParams;
//uniform float4 unity_OrthoParams;
//uniform float4 unity_CameraWorldClipPlanes[6];
//uniform mat4x4 unity_CameraProjection;
//uniform mat4x4 unity_CameraInvProjection;
//uniform float4 _WorldSpaceLightPos0;
//uniform float4 _LightPositionRange;
//uniform float4 unity_4LightPosX0;
//uniform float4 unity_4LightPosY0;
//uniform float4 unity_4LightPosZ0;
//uniform float4 unity_4LightAtten0;
//uniform float4 unity_LightColor[8];
//uniform float4 unity_LightPosition[8];
//uniform float4 unity_LightAtten[8];
//uniform float4 unity_SpotDirection[8];
//uniform float4 unity_SHAr;
//uniform float4 unity_SHAg;
//uniform float4 unity_SHAb;
//uniform float4 unity_SHBr;
//uniform float4 unity_SHBg;
//uniform float4 unity_SHBb;
//uniform float4 unity_SHC;
uniform float3 unity_LightColor0;
uniform float3 unity_LightColor1;
uniform float3 unity_LightColor2;
uniform float3 unity_LightColor3;
uniform float4x4 unity_ShadowSplitSpheres;
uniform float4 unity_ShadowSplitSqRadii;
//uniform float4 unity_LightShadowBias;
//uniform float4 _LightSplitsNear;
//uniform float4 _LightSplitsFar;
uniform mat4x4x4 unity_WorldToShadow;
//uniform float4 _LightShadowData;
// uniform float4 unity_ShadowFadeCenterAndType;
//uniform mat4x4 UNITY_MATRIX_MVP;
//uniform mat4x4 UNITY_MATRIX_MV;
//uniform mat4x4 UNITY_MATRIX_IT_MV;
//uniform mat4x4 unity_ObjectToWorld;
uniform mat4x4 unity_WorldToObject;
//uniform float4 unity_LODFade;
//uniform float4 unity_WorldTransformParams;
//uniform mat4x4 glstate_matrix_transpose_modelview0;
//uniform mat4x4 UNITY_MATRIX_P;
//uniform float4 glstate_lightmodel_ambient;
//uniform mat4x4 unity_MatrixV;
//uniform mat4x4 unity_MatrixVP;
//uniform float4 unity_AmbientSky;
//uniform float4 unity_AmbientEquator;
//uniform float4 unity_AmbientGround;
//uniform float4 unity_FogColor;
//uniform float4 unity_FogParams;
// uniform float4 unity_LightmapST;
// uniform float4 unity_DynamicLightmapST;
//uniform float4 unity_SpecCube0_BoxMax;
//uniform float4 unity_SpecCube0_BoxMin;
//uniform float4 unity_SpecCube0_ProbePosition;
//uniform float4 unity_SpecCube0_HDR;
//uniform float4 unity_SpecCube1_BoxMax;
//uniform float4 unity_SpecCube1_BoxMin;
//uniform float4 unity_SpecCube1_ProbePosition;
//uniform float4 unity_SpecCube1_HDR;
uniform float4 unity_ColorSpaceGrey;
//uniform float4 unity_ColorSpaceDouble;
uniform float4 unity_ColorSpaceDielectricSpec;
uniform float4 unity_ColorSpaceLuminance;
//uniform float4 unity_Lightmap_HDR;
uniform float4 unity_DynamicLightmap_HDR;
uniform float4 _LightColor0;
uniform float4 _SpecColor;
uniform float4 _Control_ST;
uniform float _Shininess;
uniform float4 _Splat0_ST;
uniform float4 _Splat1_ST;
uniform float4 _Splat2_ST;
uniform float4 _Splat3_ST;
uniform float4 unity_Ambient;
uniform sampler2D _Control;
uniform sampler2D _Splat0;
uniform sampler2D _Splat1;
uniform sampler2D _Splat2;
uniform sampler2D _Splat3;
struct appdata_t
{
    float4 vertex :POSITION0;
    float3 normal :NORMAL0;
    float4 texcoord :TEXCOORD0;
};

struct OUT_Data_Vert
{
    float4 texcoord :TEXCOORD0;
    float4 texcoord1 :TEXCOORD1;
    float3 texcoord2 :TEXCOORD2;
    float3 texcoord3 :TEXCOORD3;
    float2 texcoord4 :TEXCOORD4;
    float4 texcoord5 :TEXCOORD5;
    float3 texcoord6 :TEXCOORD6;
    float4 vertex :SV_POSITION;
};

struct v2f
{
    float4 texcoord :TEXCOORD0;
    float4 texcoord1 :TEXCOORD1;
    float3 texcoord2 :TEXCOORD2;
    float2 texcoord4 :TEXCOORD4;
    float3 texcoord6 :TEXCOORD6;
};

struct OUT_Data_Frag
{
    float4 color :SV_Target0;
    float4 color1 :SV_Target1;
    float4 color2 :SV_Target2;
    float4 color3 :SV_Target3;
};

float4 t0;
float4 t16_0;
float3 t1;
float t16_2;
float3 t16_3;
float t12;
OUT_Data_Vert vert(appdata_t in_v)
{
    OUT_Data_Vert out_v;
    out_v.vertex = UnityObjectToClipPos(in_v.vertex);
    out_v.texcoord.xy = TRANSFORM_TEX(in_v.texcoord.xy, _Splat0);
    out_v.texcoord.zw = TRANSFORM_TEX(in_v.texcoord.xy, _Splat1);
    out_v.texcoord1.xy = TRANSFORM_TEX(in_v.texcoord.xy, _Splat2);
    out_v.texcoord1.zw = TRANSFORM_TEX(in_v.texcoord.xy, _Splat3);
    t0.x = (in_v.normal.x * conv_mxt4x4_0(unity_WorldToObject).x);
    t0.y = (in_v.normal.x * conv_mxt4x4_1(unity_WorldToObject).x);
    t0.z = (in_v.normal.x * conv_mxt4x4_2(unity_WorldToObject).x);
    t1.x = (in_v.normal.y * conv_mxt4x4_0(unity_WorldToObject).y);
    t1.y = (in_v.normal.y * conv_mxt4x4_1(unity_WorldToObject).y);
    t1.z = (in_v.normal.y * conv_mxt4x4_2(unity_WorldToObject).y);
    t0.xyz = (t0.xyz + t1.xyz);
    t1.x = (in_v.normal.z * conv_mxt4x4_0(unity_WorldToObject).z);
    t1.y = (in_v.normal.z * conv_mxt4x4_1(unity_WorldToObject).z);
    t1.z = (in_v.normal.z * conv_mxt4x4_2(unity_WorldToObject).z);
    t0.xyz = (t0.xyz + t1.xyz);
    t0.xyz = normalize(t0.xyz);
    out_v.texcoord2.xyz = t0.xyz;
    t1.xyz = (in_v.vertex.yyy * conv_mxt4x4_1(unity_ObjectToWorld).xyz);
    t1.xyz = ((conv_mxt4x4_0(unity_ObjectToWorld).xyz * in_v.vertex.xxx) + t1.xyz);
    t1.xyz = ((conv_mxt4x4_2(unity_ObjectToWorld).xyz * in_v.vertex.zzz) + t1.xyz);
    out_v.texcoord3.xyz = ((conv_mxt4x4_3(unity_ObjectToWorld).xyz * in_v.vertex.www) + t1.xyz);
    out_v.texcoord4.xy = TRANSFORM_TEX(in_v.texcoord.xy, _Control);
    out_v.texcoord5 = float4(0, 0, 0, 0);
    t16_2 = (t0.y * t0.y);
    t16_2 = ((t0.x * t0.x) + (-t16_2));
    t16_0 = (t0.yzzx * t0.xyzz);
    t16_3.x = dot(unity_SHBr, t16_0);
    t16_3.y = dot(unity_SHBg, t16_0);
    t16_3.z = dot(unity_SHBb, t16_0);
    out_v.texcoord6.xyz = ((unity_SHC.xyz * float3(t16_2, t16_2, t16_2)) + t16_3.xyz);
    return out_v;
}

#define CODE_BLOCK_FRAGMENT
float4 t16_0_d;
float3 t10_0;
float4 t16_1;
float3 t10_1;
float3 t16_2_d;
float3 t10_2;
float3 t16_3_d;
float3 t10_3;
float4 t16_4;
float4 t10_4;
float t16_5;
float3 t10_6;
float3 t16_7;
float3 t16_13;
float t16_24;
OUT_Data_Frag frag(v2f in_f)
{
    OUT_Data_Frag out_f;
    t10_0.xyz = tex2D(_Splat3, in_f.texcoord1.zw).xyz;
    t10_1.xyz = tex2D(_Splat2, in_f.texcoord1.xy).xyz;
    t10_2.xyz = tex2D(_Splat0, in_f.texcoord.xy).xyz;
    t10_3.xyz = tex2D(_Splat1, in_f.texcoord.zw).xyz;
    t10_4 = tex2D(_Control, in_f.texcoord4.xy);
    t16_5 = dot(t10_4, float4(1, 1, 1, 1));
    t16_24 = (t16_5 + 0.00100000005);
    t16_4 = (t10_4 / float4(t16_24, t16_24, t16_24, t16_24));
    t16_3_d.xyz = (t10_3.xyz * t16_4.yyy);
    t16_2_d.xyz = ((t16_4.xxx * t10_2.xyz) + t16_3_d.xyz);
    t16_1.xyz = ((t16_4.zzz * t10_1.xyz) + t16_2_d.xyz);
    t16_0_d.xyz = ((t16_4.www * t10_0.xyz) + t16_1.xyz);
    out_f.color.xyz = (float3(t16_5, t16_5, t16_5) * t16_0_d.xyz);
    out_f.color.w = 1;
    out_f.color1.xyz = (float3(t16_5, t16_5, t16_5) * _SpecColor.xyz);
    out_f.color1.w = (t16_5 * _Shininess);
    t10_6.xyz = ((in_f.texcoord2.xyz * float3(0.5, 0.5, 0.5)) + float3(0.5, 0.5, 0.5));
    out_f.color2.xyz = (float3(t16_5, t16_5, t16_5) * t10_6.xyz);
    out_f.color2.w = 1;
    t16_1.xyz = in_f.texcoord2.xyz;
    t16_1.w = 1;
    t16_7.x = dot(unity_SHAr, t16_1);
    t16_7.y = dot(unity_SHAg, t16_1);
    t16_7.z = dot(unity_SHAb, t16_1);
    t16_13.xyz = (t16_7.xyz + in_f.texcoord6.xyz);
    t16_13.xyz = max(t16_13.xyz, float3(0, 0, 0));
    t16_2_d.xyz = log2(t16_13.xyz);
    t16_2_d.xyz = (t16_2_d.xyz * float3(0.416666657, 0.416666657, 0.416666657));
    t16_2_d.xyz = exp2(t16_2_d.xyz);
    t16_2_d.xyz = ((t16_2_d.xyz * float3(1.05499995, 1.05499995, 1.05499995)) + float3(-0.0549999997, (-0.0549999997), (-0.0549999997)));
    t16_2_d.xyz = max(t16_2_d.xyz, float3(0, 0, 0));
    t16_13.xyz = (t16_0_d.xyz * t16_2_d.xyz);
    t16_0_d.xyz = exp2((-t16_13.xyz));
    t16_0_d.w = 1;
    out_f.color3 = (float4(t16_5, t16_5, t16_5, t16_5) * t16_0_d);
    return out_f;
}


ENDCG

}
}
Fallback "Hidden/TerrainEngine/Splatmap/Diffuse-AddPass"
}